f312d1
@@ -301,6 +301,9 @@
private long evaluateExpression(Statistics stats, ExprNodeDesc pred,
       long newNumRows = 0;
       Statistics andStats = null;
 
+      if (stats.getNumRows() <= 1 || stats.getDataSize() <= 0)
+        return 1;
+
       if (pred instanceof ExprNodeGenericFuncDesc) {
         ExprNodeGenericFuncDesc genFunc = (ExprNodeGenericFuncDesc) pred;
         GenericUDF udf = genFunc.getGenericUDF();
